package com.bluefox.hospital.model;


import com.bluefox.jpa.model.AbstractAuditModel;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.*;
import java.util.Set;

@Entity
@Setter
@Getter
@ToString
public class Department extends AbstractAuditModel {

    /**
     * 科室名称
     */
    private String name;
    /**
     * 科室等级
     */
    private int level;

    /**
     * 标记
     */
    @Column(name = "remark",length = 1920)
    private String remark;
    /**
     * 排序
     */
    private int departmentOrder;
    /**
     * 是否启用
     */
    private int status;
    /**
     * 是否是重点科室
     */
    private int isKeyDepartment;
    /**
     * 房间号
     */
    private String roomNumber;

    /**
     * 科室中的医生列表
     */


    @OneToMany(mappedBy="department",cascade= CascadeType.ALL,fetch=FetchType.LAZY,orphanRemoval = true)
    @JsonIgnoreProperties({"department"})
    private Set<Doctor> doctors;

}
